<template>
  <van-nav-bar fixed placeholder>
  <template #title>
      <van-search v-model="valueKey" placeholder="请输入搜索关键词" @search="onSearch"/>
  </template>
</van-nav-bar>
</template>

<script lang='ts'>
import {Vue,Options} from 'vue-class-component';
import {Emit} from 'vue-property-decorator';
@Options({
  components:{
  }
})
export default class navBar extends Vue{
   valueKey:string="搜索名称"
   
   @Emit()//事件名对应
   onSearch(): string{
     return this.valueKey
   }
}
</script>

<style scoped lang='scss'>
:deep .van-nav-bar__title{
   width: 100%;
   max-width:100%;
}
</style>